package com.choosefine.springboot.devops.demo.beetlSql.user;

import org.beetl.sql.core.SQLManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao dao; // mapper
    @Autowired
    SQLManager sql;

    @Transactional()
    public long total() {
        return dao.allCount();
    }

    @Transactional()
    public void save(User user) {

        dao.insert(user, true);

    }

    public List allUser(User query) {
        List userList = dao.selectUser(query);
        return userList;

    }
}
